<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 4.2.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/font-awesome.min.css">


<script id="hexo-configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    hostname: new URL('http://yoursite.com').hostname,
    root: '/',
    scheme: 'Pisces',
    version: '7.7.1',
    exturl: false,
    sidebar: {"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},
    copycode: {"enable":false,"show_result":false,"style":null},
    back2top: {"enable":true,"sidebar":false,"scrollpercent":false},
    bookmark: {"enable":false,"color":"#222","save":"auto"},
    fancybox: false,
    mediumzoom: false,
    lazyload: false,
    pangu: false,
    comments: {"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},
    algolia: {
      appID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    },
    localsearch: {"enable":false,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},
    path: '',
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}}
  };
</script>

  <meta name="description" content="VSCode调试代码引用模块 1var common &#x3D; require(&#39;common.js&#39;); 报错  Error: Module “common.js” not found. (file:&#x2F;&#x2F;&#x2F;android_asset&#x2F;modules&#x2F;jvm-npm.js#89)   解决方案：原因是调试时不会把common.js模块文件一起推送到手机设备上，使用VSCode的快捷命令 Auto.js">
<meta property="og:type" content="article">
<meta property="og:title" content="脚本&#x2F;Auto-js学习小计-期间遇到问题和脱坑">
<meta property="og:url" content="http://yoursite.com/2020/03/04/%E8%84%9A%E6%9C%AC/Auto-js%E5%AD%A6%E4%B9%A0%E5%B0%8F%E8%AE%A1-%E6%9C%9F%E9%97%B4%E9%81%87%E5%88%B0%E9%97%AE%E9%A2%98%E5%92%8C%E8%84%B1%E5%9D%91/index.html">
<meta property="og:site_name" content="unltra">
<meta property="og:description" content="VSCode调试代码引用模块 1var common &#x3D; require(&#39;common.js&#39;); 报错  Error: Module “common.js” not found. (file:&#x2F;&#x2F;&#x2F;android_asset&#x2F;modules&#x2F;jvm-npm.js#89)   解决方案：原因是调试时不会把common.js模块文件一起推送到手机设备上，使用VSCode的快捷命令 Auto.js">
<meta property="og:locale" content="en_US">
<meta property="article:published_time" content="2020-03-04T14:18:11.360Z">
<meta property="article:modified_time" content="2020-02-02T07:06:59.000Z">
<meta property="article:author" content="unltra">
<meta name="twitter:card" content="summary">

<link rel="canonical" href="http://yoursite.com/2020/03/04/%E8%84%9A%E6%9C%AC/Auto-js%E5%AD%A6%E4%B9%A0%E5%B0%8F%E8%AE%A1-%E6%9C%9F%E9%97%B4%E9%81%87%E5%88%B0%E9%97%AE%E9%A2%98%E5%92%8C%E8%84%B1%E5%9D%91/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome: false,
    isPost: true
  };
</script>

  <title>脚本/Auto-js学习小计-期间遇到问题和脱坑 | unltra</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-meta">

    <div>
      <a href="/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">unltra</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
  </div>

  <div class="site-nav-toggle">
    <div class="toggle" aria-label="Toggle navigation bar">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>
</div>


<nav class="site-nav">
  
  <ul id="menu" class="menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-fw fa-home"></i>Home</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-fw fa-archive"></i>Archives</a>

  </li>
  </ul>

</nav>
</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content">
            

  <div class="posts-expand">
      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block " lang="en">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2020/03/04/%E8%84%9A%E6%9C%AC/Auto-js%E5%AD%A6%E4%B9%A0%E5%B0%8F%E8%AE%A1-%E6%9C%9F%E9%97%B4%E9%81%87%E5%88%B0%E9%97%AE%E9%A2%98%E5%92%8C%E8%84%B1%E5%9D%91/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="https://s2.ax1x.com/2020/02/04/1BYxFx.jpg">
      <meta itemprop="name" content="unltra">
      <meta itemprop="description" content="unltra-blog">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="unltra">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          脚本/Auto-js学习小计-期间遇到问题和脱坑
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">Posted on</span>

              <time title="Created: 2020-03-04 22:18:11" itemprop="dateCreated datePublished" datetime="2020-03-04T22:18:11+08:00">2020-03-04</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="fa fa-calendar-check-o"></i>
                </span>
                <span class="post-meta-item-text">Edited on</span>
                <time title="Modified: 2020-02-02 15:06:59" itemprop="dateModified" datetime="2020-02-02T15:06:59+08:00">2020-02-02</time>
              </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <ol>
<li>VSCode调试代码引用模块 <figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">var</span> common = <span class="built_in">require</span>(<span class="string">'common.js'</span>);</span><br></pre></td></tr></table></figure>
报错  <strong>Error: Module “common.js” not found. (file:///android_asset/modules/jvm-npm.js#89)</strong></li>
</ol>
<blockquote>
<p><strong>解决方案</strong>：原因是调试时不会把common.js模块文件一起推送到手机设备上，使用VSCode的快捷命令 <strong>Auto.js:Save On Device.</strong> 把引用的模块代码保存在手机上，这样代码才能引用</p>
</blockquote>
<ol start="2">
<li>在auto.js界面中使用launch(“”)可以启动app，回到手机桌面后，就启动不了</li>
</ol>
<blockquote>
<p><strong>解决方案</strong>：在应用设置中找到Auto.js（如果是打包的，那就找到对应打包的apk），勾选允许“后台弹出界面”，允许应用在后台弹出界面。不同手机系统不一样，叫的名字可能不大一样，所以自己大概看看同一个意思的，把它权限勾选上</p>
</blockquote>
<ol start="3">
<li>在此页面有弹窗，弹窗上有控件信息，但是识别不到</li>
</ol>
<blockquote>
<p><strong>解决方案</strong>：</p>
</blockquote>

    </div>

    
    
    

      <footer class="post-footer">

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/2020/03/04/%E8%84%9A%E6%9C%AC/Auto-js-%E5%AE%89%E5%8D%93intent%E7%9B%B8%E5%85%B3%E5%AE%9E%E7%8E%B0/" rel="prev" title="脚本/Auto-js-安卓intent相关实现">
      <i class="fa fa-chevron-left"></i> 脚本/Auto-js-安卓intent相关实现
    </a></div>
      <div class="post-nav-item">
    <a href="/2020/03/04/%E8%84%9A%E6%9C%AC/Auto-js%E7%BB%BC%E8%BF%B0/" rel="next" title="脚本/Auto-js综述">
      脚本/Auto-js综述 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  

  </div>


          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let activeClass = CONFIG.comments.activeClass;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          Table of Contents
        </li>
        <li class="sidebar-nav-overview">
          Overview
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="unltra"
      src="https://s2.ax1x.com/2020/02/04/1BYxFx.jpg">
  <p class="site-author-name" itemprop="name">unltra</p>
  <div class="site-description" itemprop="description">unltra-blog</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">9</span>
          <span class="site-state-item-name">posts</span>
        </a>
      </div>
  </nav>
</div>
  <div class="links-of-author motion-element">
      <span class="links-of-author-item">
        <a href="https://github.com/unltra" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;unltra" rel="noopener" target="_blank"><i class="fa fa-fw fa-github"></i>GitHub</a>
      </span>
  </div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2020</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">unltra</span>
</div>
<div style="width:300px;margin:0 auto; padding:0 0;" align="center">
<a target="_blank" href="http://www.beian.miit.gov.cn/" style="display:inline-block;text-decoration:none;height:20px;line-height:20px;">
<p style="float:left;height:20px;line-height:20px;margin: 0px 0px 0px 5px; color:#939393;">浙ICP备17019849号-1</p></a>
</div>
<div style="width:300px;margin:0 auto; padding:0 0;" align="center">
  <a target="_blank" href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=33021202000572" style="display:inline-block;text-decoration:none;height:20px;line-height:20px;">
  <img src="https://s2.ax1x.com/2019/12/18/QHme9s.png" style="float:left;"/>
<p style="float:left;height:20px;line-height:20px;margin: 0px 0px 0px 5px; color:#939393;">浙公网安备 33021202000572号</p></a>
</div>
  <div class="powered-by">Powered by <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> v4.2.0
  </div>
  <span class="post-meta-divider">|</span>
  <div class="theme-info">Theme – <a href="https://pisces.theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Pisces</a> v7.7.1
  </div>

        








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/pisces.js"></script>


<script src="/js/next-boot.js"></script>




  















  

  

</body>
</html>
